package com.dev.engine.image;

import com.dev.base.DevSource;
import ohos.aafwk.ability.fraction.Fraction;
import ohos.agp.components.Component;
import ohos.agp.components.Image;
import ohos.app.Context;

/**
 * detail: Image Engine 接口
 * @author Ttt
 */
public interface IImageEngine<Config extends IImageEngine.ImageConfig> {

    /**
     * detail: Image Config
     * @author Ttt
     */
    class ImageConfig {
    }

    // ====================
    // = pause and resume =
    // ====================

    void pause(Fraction Fraction);

    void resume(Fraction Fraction);

    void pause(Context context);

    void resume(Context context);

    // ===========
    // = preload =
    // ===========

    void preload(Context context, DevSource source);

    void preload(Context context, DevSource source, Config config);

    // =========
    // = clear =
    // =========

    void clear(Component view);

    void clear(Fraction Fraction, Component view);

    void clearDiskCache(Context context);

    void clearMemoryCache(Context context);

    void clearAllCache(Context context);

    // =========
    // = other =
    // =========

    void lowMemory(Context context);

    // ===========
    // = display =
    // ===========

    void display(Image Image, String url);

    void display(Image Image, DevSource source);

    void display(Image Image, String url, Config config);

    void display(Image Image, DevSource source, Config config);

    <T> void display(Image Image, String url, LoadListener<T> listener);

    <T> void display(Image Image, DevSource source, LoadListener<T> listener);

    <T> void display(Image Image, String url, Config config, LoadListener<T> listener);

    <T> void display(Image Image, DevSource source, Config config, LoadListener<T> listener);

    // =

    void display(Fraction Fraction, Image Image, String url);

    void display(Fraction Fraction, Image Image, DevSource source);

    void display(Fraction Fraction, Image Image, String url, Config config);

    void display(Fraction Fraction, Image Image, DevSource source, Config config);

    <T> void display(Fraction Fraction, Image Image, String url, LoadListener<T> listener);

    <T> void display(Fraction Fraction, Image Image, DevSource source, LoadListener<T> listener);

    <T> void display(Fraction Fraction, Image Image, String url, Config config, LoadListener<T> listener);

    <T> void display(Fraction Fraction, Image Image, DevSource source, Config config, LoadListener<T> listener);

    // ========
    // = load =
    // ========

    <T> void loadImage(Context context, DevSource source, Config config, LoadListener<T> listener);

    <T> void loadImage(Fraction Fraction, DevSource source, Config config, LoadListener<T> listener);

    <T> T loadImage(Context context, DevSource source, Config config, Class type);

    // =

  /*  void loadBitmap(Context context, DevSource source, Config config, LoadListener<Bitmap> listener);

    void loadBitmap(Fraction Fraction, DevSource source, Config config, LoadListener<Bitmap> listener);

    Bitmap loadBitmap(Context context, DevSource source, Config config);

    // =

    void loadDrawable(Context context, DevSource source, Config config, LoadListener<Drawable> listener);

    void loadDrawable(Fraction Fraction, DevSource source, Config config, LoadListener<Drawable> listener);

    Drawable loadDrawable(Context context, DevSource source, Config config);*/
}